←Select platform

CompareText(IList<string>) Method

Summary

Compares two strings

Syntax
C#
C++/CLI
Python
public IList<TextDifference> CompareText( 
   IList<string> texts 
) 
public:  
   IList<TextDifference^>^ CompareText( 
      IList<String^>^ texts 
   ) 
def CompareText(self,texts): 

Parameters

texts

List of strings to compare.

Return Value

A list of TextDifferences.

Remarks

Exactly two strings must be provided to this method.

Example
C#
using Leadtools.Document; 
using Leadtools.Document.Compare; 
using Leadtools; 
 
 
public void CompareTextStringExample() 
{ 
   var stringList = new List<string>() 
   { 
      "Hello World", 
      "Goodbye World" 
   }; 
 
   var comparer = new DocumentComparer(); 
   var diffs = comparer.CompareText(stringList); 
 
   foreach(TextDifference diff in diffs) 
   { 
      Console.WriteLine($"Operations: {diff.Operation}"); 
      Console.WriteLine($"Text: {diff.Text}"); 
      Console.WriteLine("--------"); 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Compare Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.